In H.264/MPEG-4 Part 10 (ISO/IEC 14496-10), regarding intra-frame prediction for luminance (luma) components, nine prediction modes for each 4×4 block and nine prediction modes for each 8×8 block are defined. In addition, four prediction modes for each 16×16 block are defined. Regarding intra-frame prediction for chrominance (chroma) components, four prediction modes for each 8×8 block are defined.
In the reference software Joint Model (JM) distributed by the organization for H.264 standardization, the sum of absolute differences (SAD) and the sum of absolute transformed differences (SATD) are used as evaluation measures for selection of an intra-frame prediction mode. However, a cost value upon prediction mode selection is obtained using any one of SAD and SATD.
SAD is the sum of absolute differences as the values of difference between an original image signal and a prediction signal. SATD is the sum of absolute values of Hadamard transform coefficients for the difference signal between the original signal and the prediction signal. The amount of calculation in Hadamard transform is remarkably larger than that in SAD operation.
Japanese Unexamined Patent Application Publication No. 2006-180195 discusses the following related art. To reduce the amount of SATD calculation in the above-described reference software JM, the direction of prediction (hereinafter, also referred to as “prediction direction”) is temporarily determined for each block size by SAD operation and SATD operation is performed on a difference image generated in the temporarily determined prediction direction for each block size. A block size is determined on the basis of the results of operation, thus reducing the number of SATD operation times.
Japanese Unexamined Patent Application Publication No. 2006-94081 discusses a related art technique in which an optimum prediction mode is selected from among a plurality of intra prediction modes and a plurality of inter prediction modes on the basis of cost values obtained by cost functions representing coding efficiencies and encoding is performed in the selected mode. According to the related art discussed in Japanese Unexamined Patent Application Publication No. 2006-94081, activity indicating a degree of flatness of an image is calculated and a cost value is corrected using the calculated activity, thus determining an optimum prediction mode.